<template>
  <div>
    <h1>list</h1>
    <p>{{count}}</p>
    <button @click="add">累加</button>
    <button @click="dec">累减</button>
  </div>
</template>

<script>
export default {
  name: "List",
  data() {
    return {
      count:0
    };
  },
  methods: {
    add(){
      this.count++;
      this.$emit('count',this.count)
    },
    dec(){
      this.count--;
      this.$$emit('count',this.count)
    }
  },
};
</script>

<style>
</style>